import datetime

import paramiko

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
private_key = paramiko.RSAKey.from_private_key_file(r"C:\Users\mg\.ssh\id_rsa")
username = 'root'
host = '47.110.92.205'
client.connect(host, username=username, pkey=private_key)
stdin, stdout, stderr = client.exec_command('cd /project/xb_bot/xb_bot && ./deploy-bot.sh')
print(stdout.read().decode('utf-8'))
client.close()
print(datetime.datetime.now(), '后端项目部署完成')
